<template>
<div class="announContent">
    <div class="title">
        <h1>{{data.post_title}}</h1>
    </div>
      <div class="con" v-html="data.post_content"></div>
</div>
</template>

<script>
import { articleDetails } from "../../../config/getData";

export default {
  data() {
    return {
      data: [],
      textLen: 0
    };
  },
  computed: {
    speed() {
      return (this.textLen / 308).toFixed(2);
    }
  },
  created() {
     this.initData();
  },
  methods: {
    initData() {
      // console.log(this.$route.params)
      var id = this.$route.params.id;
      articleDetails(id).then(res => {
        this.data = res.data;
      });
    }
  }
};
</script>


<style lang="scss" scoped>
.announContent {
  background-color: white;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  z-index: 10;
  .title {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    h1 {
      font-size: 22px;
    }
    p {
      line-height: 1;
      font-size: 0;
      margin-top: 20px;
      color: #383838;
    }
    span {
      font-size: 16px;
    }
    .time {
      display: inline-block;
      margin-left: 5px;
      padding-left: 5px;
      border-left: 1px solid #e6e6e6;
    }
  }
  > .time {
    line-height: 43px;
    color: #929292;
    text-align: center;
    border: 1px solid #eee;
    border-left: none;
    border-right: none;
  }

  .con {
    padding: 15px;
    color: #383838;
    img {
      width: 100%;
      min-height: 60px;
      background-color: #f5f5f5;
      display: block;
      margin: 15px 0;
    }
    h1 {
      font-size: 18px;
      font-weight: normal;
    }
    p {
      margin: 4px 0 15px;
      color: #636363;
    }
  }
}


</style>

